package edu.zhangxu.pojo;

public class Problem {
    private int id;
    private String name;
    private String difficulty;
    private int submitCount;
    private int acCount;
    private double pass;
    private long timeLimit;
    private double memoryLimit;
    private String description;

    public Problem() {}

//    public Problem(int id, String name, String difficulty, int submitCount, int acCount) {
//        this.id = id;
//        this.name = name;
//        this.difficulty = difficulty;
//        this.submitCount = submitCount;
//        this.acCount = acCount;
//    }

    public double calcPassRate() {
        pass = submitCount!=0?(double)acCount/submitCount:5.9;
        return pass;
    }

    public int getId() { return id; }

    public void setId(int id) { this.id = id; }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDifficulty() {
        return difficulty;
    }

    public void setDifficulty(String difficulty) {
        this.difficulty = difficulty;
    }

    public int getSubmitCount() { return submitCount; }

    public void setSubmitCount(int submitCount) { this.submitCount = submitCount; }

    public int getAcCount() { return acCount; }

    public void setAcCount(int acCount) { this.acCount = acCount; }

    public double getPass() {
        return pass;
    }

    public void setPass(double pass) {
        this.pass = pass;
    }

    public long getTimeLimit() { return timeLimit; }

    public void setTimeLimit(int timeLimit) { this.timeLimit = timeLimit; }

    public double getMemoryLimit() { return memoryLimit; }

    public void setMemoryLimit(double memoryLimit) { this.memoryLimit = memoryLimit; }

    public String getDescription() { return description; }

    public void setDescription(String description) { this.description = description; }
}
